fork download
  1. %{
  2. #include <stdio.h>
  3. int v = 0;
  4. int c = 0;
  5. %}
  6. %%
  7. \n return 0;
  8. [aeiouAEIOU] {++v;}
  9. [^aeiouAEIOU] {++c;}
  10. %%
  11. int yywrap(){
  12. return 1;
  13. }
  14. int main() {
  15. printf("enter a string: ");
  16. yylex();
  17. printf("No of Vowels = %d ",v);
  18. printf("No of Consonants = %d",c);
  19. return 0;
  20. }
Success #stdin #stdout #stderr 0.03s 6972KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/Uqih9A/prog:20:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit